﻿using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Task.DownloadImage.Models;

namespace Task.DownloadImage.ViewModels
{
    
    public class MainWindowViewModels:ViewModelBase
    {
        private ObservableCollection<NetImageSource> datas;

        public ObservableCollection<NetImageSource> Datas
        {
            get { return datas; }
            set { datas = value; }
        }

        public MainWindowViewModels()
        {
            Datas = new ObservableCollection<NetImageSource>();
            Datas.Add(new NetImageSource {Height = 120,Width = 160,URL = string.Empty });
            Datas.Add(new NetImageSource {Height = 120,Width = 160,URL = string.Empty });
            Datas.Add(new NetImageSource {Height = 120,Width = 160,URL = string.Empty });
        }

        private RelayCommand executeLoad;

        public RelayCommand ExecuteLoad
        {
            get
            {
                return executeLoad ?? new RelayCommand(()=>
                {
                    Datas[0].URL = $"http://122.152.195.57:10002//wallheaven/women.jpg";
                    Datas[1].URL = $"http://122.152.195.57:10002//wallheaven/women_2.jpg";
                    Datas[2].URL = $"http://122.152.195.57:10002//wallheaven/women_3.jpg";
                });
            }
        }


    }
}
